﻿using System;
using System.Collections.Generic;

namespace BlogEngine.MongoDbProvider
{
    public class MongoMapperFactory : IMongoMapperFactory
    {
        public static Dictionary<string, Type> mapperConfig = 
            new Dictionary<string, Type>()
                {
                    {"Post",typeof(PostMongoMapper)}
                };

        public IMongoMapper<TEntity> GetMapper<TEntity>()
        {
            return Activator.CreateInstance(mapperConfig[typeof (TEntity).Name]) as IMongoMapper<TEntity>;
        }
    }
}